<?php
$url='https://api.weibo.com/oauth2/access_token';
$data = array ('client_id' => '1373380592',
	'client_secret' => 'cab44f7072f015dd741e2b8c932509f8',
	'grant_type' => 'authorization_code',
	'code' => 'a09f5dfa948999406419dd940e1f2cde',
	'redirect_uri' => base_url().'index.php?c=web&m=index'
);
$data = http_build_query($data);

$params = array('http' => array(
	//'header'=> "Content-type: application/x-www-form-urlencoded\r\n"
	                //. "Content-Length: " . strlen($data) . "\r\n",
	'method' => 'POST',
	'content' => $data
));

//if ($optional_headers !== null) {
	//$params['http']['header'] = 'application/x-www-form-urlencoded';
	//}

$ctx = stream_context_create($params);
$fp = @fopen($url, 'rb', false, $ctx);
$response = @stream_get_contents($fp);

echo $response;
?>